
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.spoto.oa.model.*" isELIgnored="false"%>
<%@ page import="com.spoto.oa.util.*"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<meta content="text/html; charset=utf-8">

		<link href="style/v1/common/welcome.css" rel="stylesheet">
		<script type="text/javascript" src="js/lib/jquery-1.4.2.js">

</script>
		<script type="text/javascript" src="js/lib/jquery.validate.js">

</script>

		<script src="js/common/list.js" type="text/javascript">

</script>
		<style type="text/css">
.img {
	background: url(style/v1/images/consumer.png) no-repeat;
	width: 24px;
	height: 24px;
}
</style>
	</head>

	<body>
		<div id="welcome">

			<%
				Object ob = request.getAttribute("customers");
				if (null != ob) {
					PageUtil pc = new PageUtil();
					String searchType = request.getParameter("searchType");
					String type = request.getParameter("op_type");
					String info = request.getParameter("infor");
					pc.setCurrentPage(request.getParameter("page")); //设置当前页面
					pc.setPageCount(2); //设置每页记录数
					pc.setRecordCount(((List<Customer>) ob).size()); //设置记录条数
					pc.setPageUrl("CustomerServlet?op_type=" + type
							+ "&searchType=" + searchType + "&infor=" + info); //设置跳转页面url
					List<Customer> customers = pc.getSubList((List<Customer>) ob); //获取当前页面记录
					System.out.println("ad");
					if (customers.isEmpty()) {
					
			%>
			<center>
				不存在该用户
			</center>
			<%
				} else {
			%>
			<div id="list">
				<div class="view">
					<form action="CustomerServlet" method="post">
						<div id="table-ope-left">
							<input type="hidden" name="op_type" value="multi_del" />
							<button type="button" class="select_btn" name="select_all">
								全选
							</button>
							<button type="button" class="select_btn" name="select_reverse">
								反选
							</button>
							<button type="button" class="select_btn" name="select_cancel">
								取消
							</button>
							<input type="submit" id="mul-del" value="删除选中" />
						</div>
						<div id="table-ope-right">
							<%=pc.getPageJumpLinkHtml()%>

						</div>
						<div id="c"></div>

						<table class="table" cellspacing="0">
							<tr class="firstrow">
								<td>
									客户姓名
								</td>
								<td>
									公司名称
								</td>
								<td>
									手机号码
								</td>
								<td>
									重要程度
								</td>
								<td>
									操作
								</td>
							</tr>
							<%
								int i = 0;
										for (Customer e : customers) {
											i++;
							%>


							<tr>
								<td style="text-align: left">
									<input type="checkbox" name="del-flag" value="<%=e.getName()%>" />
									<a
										href="CustomerServlet?op_type=to_update&name=<%=e.getName()%>">
										<%
											out.print(e.getName());
										%> </a>


								</td>
								<td>
									<%=e.getCompany()%>
								</td>
								<td>
									<%=e.getMobile()%>
								</td>
								<td>
									<%=e.getLevel()%>
								</td>
								<td>
									<a href="CustomerServlet?name=<%=e.getName()%>&op_type=delete"
										onclick="return isDelete()">删除</a>
									<a
										href="CustomerServlet?name=<%=e.getName()%>&op_type=to_update">修改</a>
								</td>
							</tr>


							<%
								}
							%>

						</table>
					</form>
					<div class="page-no">
						<ul>
							<%=pc.getJavaScriptJumpCode()%>
							<li id="statue">
								<%=pc.getPageCountHtml()%>
							</li>
							<li class="jump">
								<%=pc.getPageFormJumpHtml()%>
							</li>
						</ul>

					</div>

				</div>
				<%
					}
					}
				%>
			</div>


		</div>

	</body>
</html>
